package com.hpeu_01.CarApp;

import lombok.Data;

@Data
public class Car extends Automobile{
    String model;//型号

    public Car(String carNumber, String brand, int dailyRent, String model) {
        super(carNumber, brand, dailyRent);
        this.model = model;
    }

    //计算租金
    @Override
    public float rent(int days) {
        float price = this.getDailyRent() * days;
        if(days>7 && days<=30){
            price*=0.9f;
        }else if(days>30 && days<=150){
            price*=0.8f;
        }else if(days>150){
            price*=0.7f;
        }
        return price;
    }
}
